package com.eshop.modules.mp.handler;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

@Component
public class RedisHandler
{
    @Autowired
    RedisTemplate redisTemplate;
    
    public String getVal(final String key) {
        try {
            final String value = this.redisTemplate.opsForValue().get((Object)key).toString();
            return value;
        }
        catch (Exception e) {
            return "";
        }
    }
    
    public Object getObj(final String key) {
        return this.redisTemplate.opsForValue().get((Object)key);
    }
}
